package ua.in.hut;

/**
 *
 * @author solyanik
 */
public class AuthException extends Exception {

	public AuthException() {
	}

	public AuthException(int errorCode) {
		this.errorCode = errorCode;
	}

	public AuthException(int errorCode, String message) {
		super(message);
		this.errorCode = errorCode;
	}

	public AuthException(String message) {
		super(message);
	}

	public AuthException(String message, Throwable cause) {
		super(message, cause);
	}

	public AuthException(int errorCode, String message, Throwable cause) {
		super(message, cause);
		this.errorCode = errorCode;
	}

	public AuthException(Throwable cause) {
		super(cause);
	}

	public AuthException(int errorCode, Throwable cause) {
		super(cause);
		this.errorCode = errorCode;
	}

	public AuthException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
		super(message, cause, enableSuppression, writableStackTrace);
	}

	public boolean isAlreadyAuthenticate() {
		return errorCode == ALREADY_AUTHENTICATE;
	}

	public int getErrorCode() {
		return errorCode;
	}

	private int errorCode = 0;
	public static int ANY_ERROR = 0;
	public static int ALREADY_AUTHENTICATE = 1;
}
